#!/usr/bin/env python
# -*- coding:UTF-8 -*-
"""
template_method.py
模板方法代码原型
"""
from abc import ABCMeta, abstractmethod

class Product(object):
    __metaclass__ = ABCMeta

    def show(self): return 'product named {}'.format(self.get_product_name())

    @abstractmethod
    def get_product_name(self): pass


class ProductA(Product):
    def get_product_name(self): return self.__class__.__name__


class ProductB(Product):
    def get_product_name(self): return self.__class__.__name__
